package com.hospital.demo.controller.jiashuai;

import com.hospital.demo.model.jiashuai.Worker;
import com.hospital.demo.service.jiashuai.IWorkerService;
import com.hospital.demo.service.jiashuai.LoginSer;
import com.hospital.demo.util.ResultUtils;
import com.hospital.demo.util.ResultVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/login")
public class LoginCon {

    @Autowired
    private LoginSer loginSer;

    @ApiOperation(value = "用户注册")
    @PostMapping("/RegisterUser")
    private ResultVO registerUser(int account, String password, int type) {
        return ResultUtils.success(loginSer.resign(account, password, type));
    }

    @ApiOperation(value = "用户登录", notes = "")
    @GetMapping("/login")
    private ResultVO login(int account, String password,int type) {
        return ResultUtils.success(loginSer.login(account, password, type));
    }

}
